/**
 * 登录组件
 */
import React, { Component } from 'react';

class Login extends Component {

  // 登录事件
  login = (e) => {
    // console.log(e)
    e.preventDefault();
    console.log(this.props);
    const { push, go } = this.props.history;
    // 存储token
    localStorage.setItem('token', Math.random() * 1000)

    push('/');
    // go(-1)

  }
  render() {
    return (
      <div>
        <form onSubmit={this.login}>
          <p><input type="text" /></p>
          <p><input type="password" /></p>
          <button>登录</button>
        </form>
      </div>
    );
  }
}

export default Login;